/*
 * 字典数据管理 Mock 数据
 * 基于蒜苔系统字典管理设计文档，为每个字典类型提供对应的字典数据项
 */

import type { SysDictData } from './types';

// 字典数据 Mock 数据 - 为每个字典类型提供对应的数据项
const mockDictData: SysDictData[] = [
  // 用户状态字典数据
  {
    id: 1,
    dictTypeId: 1,
    dictType: 'user_status',
    dictLabel: '正常',
    dictValue: '1',
    dictDesc: '用户状态正常，可以正常使用系统功能',
    parentId: 0,
    level: 1,
    path: '1',
    isLeaf: 1,
    status: 1,
    isDefault: 1,
    sortOrder: 1,
    cssClass: 'success',
    listClass: 'success',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:00:00',
    updatedTime: '2025-01-20 10:00:00'
  },
  {
    id: 2,
    dictTypeId: 1,
    dictType: 'user_status',
    dictLabel: '禁用',
    dictValue: '0',
    dictDesc: '用户被禁用，无法登录和使用系统',
    parentId: 0,
    level: 1,
    path: '2',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 2,
    cssClass: 'danger',
    listClass: 'danger',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:00:00',
    updatedTime: '2025-01-20 10:00:00'
  },
  {
    id: 3,
    dictTypeId: 1,
    dictType: 'user_status',
    dictLabel: '待审核',
    dictValue: '2',
    dictDesc: '新注册用户，等待管理员审核',
    parentId: 0,
    level: 1,
    path: '3',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 3,
    cssClass: 'warning',
    listClass: 'warning',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:00:00',
    updatedTime: '2025-01-20 10:00:00'
  },

  // 用户性别字典数据
  {
    id: 4,
    dictTypeId: 2,
    dictType: 'user_gender',
    dictLabel: '男',
    dictValue: '1',
    dictDesc: '男性用户',
    parentId: 0,
    level: 1,
    path: '4',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 1,
    cssClass: 'primary',
    listClass: 'primary',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:01:00',
    updatedTime: '2025-01-20 10:01:00'
  },
  {
    id: 5,
    dictTypeId: 2,
    dictType: 'user_gender',
    dictLabel: '女',
    dictValue: '2',
    dictDesc: '女性用户',
    parentId: 0,
    level: 1,
    path: '5',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 2,
    cssClass: 'pink',
    listClass: 'pink',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:01:00',
    updatedTime: '2025-01-20 10:01:00'
  },
  {
    id: 6,
    dictTypeId: 2,
    dictType: 'user_gender',
    dictLabel: '未知',
    dictValue: '0',
    dictDesc: '性别未知或不愿透露',
    parentId: 0,
    level: 1,
    path: '6',
    isLeaf: 1,
    status: 1,
    isDefault: 1,
    sortOrder: 3,
    cssClass: 'default',
    listClass: 'default',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:01:00',
    updatedTime: '2025-01-20 10:01:00'
  },

  // 订单状态字典数据
  {
    id: 7,
    dictTypeId: 3,
    dictType: 'order_status',
    dictLabel: '待支付',
    dictValue: '1',
    dictDesc: '订单已创建，等待用户支付',
    parentId: 0,
    level: 1,
    path: '7',
    isLeaf: 1,
    status: 1,
    isDefault: 1,
    sortOrder: 1,
    cssClass: 'warning',
    listClass: 'warning',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:02:00',
    updatedTime: '2025-01-20 10:02:00'
  },
  {
    id: 8,
    dictTypeId: 3,
    dictType: 'order_status',
    dictLabel: '已支付',
    dictValue: '2',
    dictDesc: '订单支付成功，等待发货',
    parentId: 0,
    level: 1,
    path: '8',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 2,
    cssClass: 'processing',
    listClass: 'processing',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:02:00',
    updatedTime: '2025-01-20 10:02:00'
  },
  {
    id: 9,
    dictTypeId: 3,
    dictType: 'order_status',
    dictLabel: '配送中',
    dictValue: '3',
    dictDesc: '订单正在配送途中',
    parentId: 0,
    level: 1,
    path: '9',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 3,
    cssClass: 'processing',
    listClass: 'processing',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:02:00',
    updatedTime: '2025-01-20 10:02:00'
  },
  {
    id: 10,
    dictTypeId: 3,
    dictType: 'order_status',
    dictLabel: '已完成',
    dictValue: '4',
    dictDesc: '订单已完成，交易结束',
    parentId: 0,
    level: 1,
    path: '10',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 4,
    cssClass: 'success',
    listClass: 'success',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:02:00',
    updatedTime: '2025-01-20 10:02:00'
  },
  {
    id: 11,
    dictTypeId: 3,
    dictType: 'order_status',
    dictLabel: '已取消',
    dictValue: '0',
    dictDesc: '订单已取消',
    parentId: 0,
    level: 1,
    path: '11',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 5,
    cssClass: 'danger',
    listClass: 'danger',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:02:00',
    updatedTime: '2025-01-20 10:02:00'
  },

  // 支付方式字典数据
  {
    id: 12,
    dictTypeId: 4,
    dictType: 'payment_method',
    dictLabel: '微信支付',
    dictValue: 'wechat',
    dictDesc: '使用微信进行支付',
    parentId: 0,
    level: 1,
    path: '12',
    isLeaf: 1,
    status: 1,
    isDefault: 1,
    sortOrder: 1,
    cssClass: 'success',
    listClass: 'success',
    extraData: '{"icon": "wechat", "color": "#1AAD19"}',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:03:00',
    updatedTime: '2025-01-20 10:03:00'
  },
  {
    id: 13,
    dictTypeId: 4,
    dictType: 'payment_method',
    dictLabel: '支付宝',
    dictValue: 'alipay',
    dictDesc: '使用支付宝进行支付',
    parentId: 0,
    level: 1,
    path: '13',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 2,
    cssClass: 'primary',
    listClass: 'primary',
    extraData: '{"icon": "alipay", "color": "#1677FF"}',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:03:00',
    updatedTime: '2025-01-20 10:03:00'
  },
  {
    id: 14,
    dictTypeId: 4,
    dictType: 'payment_method',
    dictLabel: '银行卡',
    dictValue: 'bank',
    dictDesc: '使用银行卡进行支付',
    parentId: 0,
    level: 1,
    path: '14',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 3,
    cssClass: 'warning',
    listClass: 'warning',
    extraData: '{"icon": "bank", "color": "#FA8C16"}',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:03:00',
    updatedTime: '2025-01-20 10:03:00'
  },
  {
    id: 15,
    dictTypeId: 4,
    dictType: 'payment_method',
    dictLabel: '现金',
    dictValue: 'cash',
    dictDesc: '现金支付',
    parentId: 0,
    level: 1,
    path: '15',
    isLeaf: 1,
    status: 0, // 禁用状态，用于测试
    isDefault: 0,
    sortOrder: 4,
    cssClass: 'default',
    listClass: 'default',
    extraData: '{"icon": "money", "color": "#8C8C8C"}',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:03:00',
    updatedTime: '2025-01-20 10:03:00'
  },

  // 操作类型字典数据
  {
    id: 16,
    dictTypeId: 5,
    dictType: 'operation_type',
    dictLabel: '新增',
    dictValue: 'create',
    dictDesc: '创建新的数据记录',
    parentId: 0,
    level: 1,
    path: '16',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 1,
    cssClass: 'success',
    listClass: 'success',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:04:00',
    updatedTime: '2025-01-20 10:04:00'
  },
  {
    id: 17,
    dictTypeId: 5,
    dictType: 'operation_type',
    dictLabel: '修改',
    dictValue: 'update',
    dictDesc: '修改现有数据记录',
    parentId: 0,
    level: 1,
    path: '17',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 2,
    cssClass: 'warning',
    listClass: 'warning',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:04:00',
    updatedTime: '2025-01-20 10:04:00'
  },
  {
    id: 18,
    dictTypeId: 5,
    dictType: 'operation_type',
    dictLabel: '删除',
    dictValue: 'delete',
    dictDesc: '删除数据记录',
    parentId: 0,
    level: 1,
    path: '18',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 3,
    cssClass: 'danger',
    listClass: 'danger',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:04:00',
    updatedTime: '2025-01-20 10:04:00'
  },
  {
    id: 19,
    dictTypeId: 5,
    dictType: 'operation_type',
    dictLabel: '查询',
    dictValue: 'read',
    dictDesc: '查询数据记录',
    parentId: 0,
    level: 1,
    path: '19',
    isLeaf: 1,
    status: 1,
    isDefault: 1,
    sortOrder: 4,
    cssClass: 'primary',
    listClass: 'primary',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:04:00',
    updatedTime: '2025-01-20 10:04:00'
  },
  {
    id: 20,
    dictTypeId: 5,
    dictType: 'operation_type',
    dictLabel: '登录',
    dictValue: 'login',
    dictDesc: '用户登录系统',
    parentId: 0,
    level: 1,
    path: '20',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 5,
    cssClass: 'processing',
    listClass: 'processing',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:04:00',
    updatedTime: '2025-01-20 10:04:00'
  },
  {
    id: 21,
    dictTypeId: 5,
    dictType: 'operation_type',
    dictLabel: '登出',
    dictValue: 'logout',
    dictDesc: '用户退出系统',
    parentId: 0,
    level: 1,
    path: '21',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 6,
    cssClass: 'default',
    listClass: 'default',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:04:00',
    updatedTime: '2025-01-20 10:04:00'
  },

  // 风险等级字典数据
  {
    id: 22,
    dictTypeId: 6,
    dictType: 'risk_level',
    dictLabel: '低风险',
    dictValue: '1',
    dictDesc: '操作风险较低，可以正常执行',
    parentId: 0,
    level: 1,
    path: '22',
    isLeaf: 1,
    status: 1,
    isDefault: 1,
    sortOrder: 1,
    cssClass: 'success',
    listClass: 'success',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:05:00',
    updatedTime: '2025-01-20 10:05:00'
  },
  {
    id: 23,
    dictTypeId: 6,
    dictType: 'risk_level',
    dictLabel: '中风险',
    dictValue: '2',
    dictDesc: '操作有一定风险，需要谨慎处理',
    parentId: 0,
    level: 1,
    path: '23',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 2,
    cssClass: 'warning',
    listClass: 'warning',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:05:00',
    updatedTime: '2025-01-20 10:05:00'
  },
  {
    id: 24,
    dictTypeId: 6,
    dictType: 'risk_level',
    dictLabel: '高风险',
    dictValue: '3',
    dictDesc: '操作风险很高，需要特别审批',
    parentId: 0,
    level: 1,
    path: '24',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 3,
    cssClass: 'danger',
    listClass: 'danger',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:05:00',
    updatedTime: '2025-01-20 10:05:00'
  },

  // 行政区划字典数据（省级示例）
  {
    id: 25,
    dictTypeId: 7,
    dictType: 'region',
    dictLabel: '北京市',
    dictValue: '110000',
    dictDesc: '北京市',
    parentId: 0,
    level: 1,
    path: '25',
    isLeaf: 0,
    status: 1,
    isDefault: 0,
    sortOrder: 1,
    cssClass: 'primary',
    listClass: 'primary',
    extraData: '{"code": "110000", "type": "province"}',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:06:00',
    updatedTime: '2025-01-20 10:06:00'
  },
  {
    id: 26,
    dictTypeId: 7,
    dictType: 'region',
    dictLabel: '上海市',
    dictValue: '310000',
    dictDesc: '上海市',
    parentId: 0,
    level: 1,
    path: '26',
    isLeaf: 0,
    status: 1,
    isDefault: 0,
    sortOrder: 2,
    cssClass: 'primary',
    listClass: 'primary',
    extraData: '{"code": "310000", "type": "province"}',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:06:00',
    updatedTime: '2025-01-20 10:06:00'
  },
  {
    id: 27,
    dictTypeId: 7,
    dictType: 'region',
    dictLabel: '广东省',
    dictValue: '440000',
    dictDesc: '广东省',
    parentId: 0,
    level: 1,
    path: '27',
    isLeaf: 0,
    status: 1,
    isDefault: 1,
    sortOrder: 3,
    cssClass: 'primary',
    listClass: 'primary',
    extraData: '{"code": "440000", "type": "province"}',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:06:00',
    updatedTime: '2025-01-20 10:06:00'
  },

  // 行业分类字典数据
  {
    id: 28,
    dictTypeId: 8,
    dictType: 'industry',
    dictLabel: '信息技术',
    dictValue: 'IT',
    dictDesc: '信息技术行业',
    parentId: 0,
    level: 1,
    path: '28',
    isLeaf: 0,
    status: 1,
    isDefault: 1,
    sortOrder: 1,
    cssClass: 'processing',
    listClass: 'processing',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:07:00',
    updatedTime: '2025-01-20 10:07:00'
  },
  {
    id: 29,
    dictTypeId: 8,
    dictType: 'industry',
    dictLabel: '金融服务',
    dictValue: 'FINANCE',
    dictDesc: '金融服务行业',
    parentId: 0,
    level: 1,
    path: '29',
    isLeaf: 0,
    status: 1,
    isDefault: 0,
    sortOrder: 2,
    cssClass: 'warning',
    listClass: 'warning',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:07:00',
    updatedTime: '2025-01-20 10:07:00'
  },
  {
    id: 30,
    dictTypeId: 8,
    dictType: 'industry',
    dictLabel: '制造业',
    dictValue: 'MANUFACTURING',
    dictDesc: '制造业',
    parentId: 0,
    level: 1,
    path: '30',
    isLeaf: 0,
    status: 1,
    isDefault: 0,
    sortOrder: 3,
    cssClass: 'success',
    listClass: 'success',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-20 10:07:00',
    updatedTime: '2025-01-20 10:07:00'
  },

  // 异常类型字典数据（用户创建）
  {
    id: 31,
    dictTypeId: 9,
    dictType: 'error_type',
    dictLabel: '系统异常',
    dictValue: 'SYSTEM_ERROR',
    dictDesc: '系统内部错误',
    parentId: 0,
    level: 1,
    path: '31',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 1,
    cssClass: 'danger',
    listClass: 'danger',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-21 09:15:00',
    updatedTime: '2025-01-21 09:15:00'
  },
  {
    id: 32,
    dictTypeId: 9,
    dictType: 'error_type',
    dictLabel: '业务异常',
    dictValue: 'BUSINESS_ERROR',
    dictDesc: '业务逻辑错误',
    parentId: 0,
    level: 1,
    path: '32',
    isLeaf: 1,
    status: 1,
    isDefault: 1,
    sortOrder: 2,
    cssClass: 'warning',
    listClass: 'warning',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-21 09:15:00',
    updatedTime: '2025-01-21 09:15:00'
  },
  {
    id: 33,
    dictTypeId: 9,
    dictType: 'error_type',
    dictLabel: '网络异常',
    dictValue: 'NETWORK_ERROR',
    dictDesc: '网络连接错误',
    parentId: 0,
    level: 1,
    path: '33',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 3,
    cssClass: 'processing',
    listClass: 'processing',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-21 09:15:00',
    updatedTime: '2025-01-21 09:15:00'
  },

  // 异常级别字典数据（用户创建）
  {
    id: 34,
    dictTypeId: 10,
    dictType: 'error_level',
    dictLabel: '低',
    dictValue: '1',
    dictDesc: '低级别异常，不影响系统正常运行',
    parentId: 0,
    level: 1,
    path: '34',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 1,
    cssClass: 'success',
    listClass: 'success',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-21 09:16:00',
    updatedTime: '2025-01-21 09:16:00'
  },
  {
    id: 35,
    dictTypeId: 10,
    dictType: 'error_level',
    dictLabel: '中',
    dictValue: '2',
    dictDesc: '中级别异常，需要关注处理',
    parentId: 0,
    level: 1,
    path: '35',
    isLeaf: 1,
    status: 1,
    isDefault: 1,
    sortOrder: 2,
    cssClass: 'warning',
    listClass: 'warning',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-21 09:16:00',
    updatedTime: '2025-01-21 09:16:00'
  },
  {
    id: 36,
    dictTypeId: 10,
    dictType: 'error_level',
    dictLabel: '高',
    dictValue: '3',
    dictDesc: '高级别异常，严重影响系统功能',
    parentId: 0,
    level: 1,
    path: '36',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 3,
    cssClass: 'danger',
    listClass: 'danger',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-21 09:16:00',
    updatedTime: '2025-01-21 09:16:00'
  },
  {
    id: 37,
    dictTypeId: 10,
    dictType: 'error_level',
    dictLabel: '紧急',
    dictValue: '4',
    dictDesc: '紧急异常，需要立即处理',
    parentId: 0,
    level: 1,
    path: '37',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 4,
    cssClass: 'danger',
    listClass: 'danger',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-21 09:16:00',
    updatedTime: '2025-01-21 09:16:00'
  },

  // 二维码类型字典数据（禁用状态的字典类型）
  {
    id: 38,
    dictTypeId: 11,
    dictType: 'qrcode_type',
    dictLabel: '支付码',
    dictValue: 'PAYMENT',
    dictDesc: '用于支付的二维码',
    parentId: 0,
    level: 1,
    path: '38',
    isLeaf: 1,
    status: 0, // 禁用状态，用于测试
    isDefault: 0,
    sortOrder: 1,
    cssClass: 'success',
    listClass: 'success',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-21 14:20:00',
    updatedTime: '2025-01-21 14:20:00'
  },
  {
    id: 39,
    dictTypeId: 11,
    dictType: 'qrcode_type',
    dictLabel: '会员码',
    dictValue: 'MEMBER',
    dictDesc: '会员身份识别二维码',
    parentId: 0,
    level: 1,
    path: '39',
    isLeaf: 1,
    status: 0, // 禁用状态，用于测试
    isDefault: 1,
    sortOrder: 2,
    cssClass: 'primary',
    listClass: 'primary',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-21 14:20:00',
    updatedTime: '2025-01-21 14:20:00'
  },
  {
    id: 40,
    dictTypeId: 11,
    dictType: 'qrcode_type',
    dictLabel: '商品码',
    dictValue: 'PRODUCT',
    dictDesc: '商品信息二维码',
    parentId: 0,
    level: 1,
    path: '40',
    isLeaf: 1,
    status: 0, // 禁用状态，用于测试
    isDefault: 0,
    sortOrder: 3,
    cssClass: 'warning',
    listClass: 'warning',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-21 14:20:00',
    updatedTime: '2025-01-21 14:20:00'
  },

  // 通用状态字典数据（用户创建）
  {
    id: 41,
    dictTypeId: 12,
    dictType: 'common_status',
    dictLabel: '启用',
    dictValue: '1',
    dictDesc: '功能或数据处于启用状态',
    parentId: 0,
    level: 1,
    path: '41',
    isLeaf: 1,
    status: 1,
    isDefault: 1,
    sortOrder: 1,
    cssClass: 'success',
    listClass: 'success',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-22 11:30:00',
    updatedTime: '2025-01-22 11:30:00'
  },
  {
    id: 42,
    dictTypeId: 12,
    dictType: 'common_status',
    dictLabel: '禁用',
    dictValue: '0',
    dictDesc: '功能或数据处于禁用状态',
    parentId: 0,
    level: 1,
    path: '42',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 2,
    cssClass: 'danger',
    listClass: 'danger',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-22 11:30:00',
    updatedTime: '2025-01-22 11:30:00'
  },
  {
    id: 43,
    dictTypeId: 12,
    dictType: 'common_status',
    dictLabel: '草稿',
    dictValue: '2',
    dictDesc: '数据处于草稿状态，未正式生效',
    parentId: 0,
    level: 1,
    path: '43',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 3,
    cssClass: 'default',
    listClass: 'default',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-22 11:30:00',
    updatedTime: '2025-01-22 11:30:00'
  },
  {
    id: 44,
    dictTypeId: 12,
    dictType: 'common_status',
    dictLabel: '审核中',
    dictValue: '3',
    dictDesc: '数据正在审核过程中',
    parentId: 0,
    level: 1,
    path: '44',
    isLeaf: 1,
    status: 1,
    isDefault: 0,
    sortOrder: 4,
    cssClass: 'processing',
    listClass: 'processing',
    extraData: '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: '',
    createdTime: '2025-01-22 11:30:00',
    updatedTime: '2025-01-22 11:30:00'
  }
];
// 获取字典数据列表
export function getMockSysDictDataData(params: any = {}) {
  let filteredData = [...mockDictData];
  
  // 按字典类型筛选
  if (params.dictType) {
    filteredData = filteredData.filter(item => 
      item.dictType === params.dictType
    );
  }
  
  // 按字典类型ID筛选
  if (params.dictTypeId) {
    filteredData = filteredData.filter(item => 
      item.dictTypeId === params.dictTypeId
    );
  }
  
  // 搜索过滤 - 按字典标签搜索
  if (params.dictLabel) {
    filteredData = filteredData.filter(item => 
      item.dictLabel.includes(params.dictLabel)
    );
  }
  
  // 搜索过滤 - 按字典值搜索
  if (params.dictValue) {
    filteredData = filteredData.filter(item => 
      item.dictValue.includes(params.dictValue)
    );
  }
  
  // 状态筛选
  if (params.status !== undefined && params.status !== null) {
    filteredData = filteredData.filter(item => 
      item.status === params.status
    );
  }
  
  // 默认值筛选
  if (params.isDefault !== undefined && params.isDefault !== null) {
    filteredData = filteredData.filter(item => 
      item.isDefault === params.isDefault
    );
  }
  
  // 排序
  filteredData.sort((a, b) => {
    // 先按字典类型排序，再按排序字段排序
    if (a.dictType !== b.dictType) {
      return a.dictType.localeCompare(b.dictType);
    }
    return a.sortOrder - b.sortOrder;
  });
  
  // 分页
  const pageSize = params.pageSize || 10;
  const current = params.current || params.pageNumber || 1;
  const start = (current - 1) * pageSize;
  const end = start + pageSize;
  
  return {
    data: {
      records: filteredData.slice(start, end),
      total: filteredData.length,
      current,
      pageSize
    }
  };
}

// 获取字典数据详情
export function mockFetchSysDictDataDetail(id: number | string) {
  console.log('mockFetchSysDictDataDetail called with id:', id, 'type:', typeof id);
  console.log('Available IDs in mockDictData:', mockDictData.map(item => item.id));
  
  // 确保ID是数字类型进行比较
  const numericId = typeof id === 'string' ? parseInt(id, 10) : id;
  console.log('Numeric id for comparison:', numericId);
  
  const item = mockDictData.find(item => item.id === numericId);
  console.log('Found item:', item);
  
  if (!item) {
    console.log('Item not found for id:', numericId);
    return { success: false, message: '字典数据不存在' };
  }
  return { success: true, data: item };
}

// 新增字典数据
export function mockAddSysDictData(data: Partial<SysDictData>) {
  // 检查同一字典类型下字典值是否已存在
  const exists = mockDictData.some(item => 
    item.dictType === data.dictType && item.dictValue === data.dictValue
  );
  if (exists) {
    return { success: false, message: '该字典类型下字典值已存在' };
  }
  
  const newId = Math.max(...mockDictData.map(item => item.id)) + 1;
  const now = new Date().toLocaleString('zh-CN', {
    year: 'numeric',
    month: '2-digit',
    day: '2-digit',
    hour: '2-digit',
    minute: '2-digit',
    second: '2-digit'
  }).replace(/\//g, '-');
  
  const newItem: SysDictData = {
    id: newId,
    dictTypeId: data.dictTypeId || 0,
    dictType: data.dictType || '',
    dictLabel: data.dictLabel || '',
    dictValue: data.dictValue || '',
    dictDesc: data.dictDesc || '',
    parentId: data.parentId || 0,
    level: data.level || 1,
    path: newId.toString(),
    isLeaf: data.isLeaf || 1,
    status: data.status || 1,
    isDefault: data.isDefault || 0,
    sortOrder: data.sortOrder || 0,
    cssClass: data.cssClass || 'default',
    listClass: data.listClass || 'default',
    extraData: data.extraData || '',
    createdBy: 1,
    updatedBy: 1,
    deleted: 0,
    constraint: data.constraint || '',
    createdTime: now,
    updatedTime: now
  };
  
  // 如果设置为默认值，需要取消同类型其他项的默认状态
  if (newItem.isDefault === 1) {
    mockDictData.forEach(item => {
      if (item.dictType === newItem.dictType && item.id !== newItem.id) {
        item.isDefault = 0;
        item.updatedTime = now;
      }
    });
  }
  
  mockDictData.push(newItem);
  return { success: true, data: newItem };
}

// 编辑字典数据
export function mockEditSysDictData(id: number, data: Partial<SysDictData>) {
  const index = mockDictData.findIndex(item => item.id === id);
  if (index === -1) {
    return { success: false, message: '字典数据不存在' };
  }
  
  // 检查同一字典类型下字典值是否已存在（排除自己）
  if (data.dictValue) {
    const exists = mockDictData.some(item => 
      item.dictType === mockDictData[index].dictType && 
      item.dictValue === data.dictValue && 
      item.id !== id
    );
    if (exists) {
      return { success: false, message: '该字典类型下字典值已存在' };
    }
  }
  
  const now = new Date().toLocaleString('zh-CN', {
    year: 'numeric',
    month: '2-digit',
    day: '2-digit',
    hour: '2-digit',
    minute: '2-digit',
    second: '2-digit'
  }).replace(/\//g, '-');
  
  const oldDictType = mockDictData[index].dictType;
  
  mockDictData[index] = {
    ...mockDictData[index],
    ...data,
    id, // 确保ID不被修改
    updatedTime: now
  };
  
  // 如果设置为默认值，需要取消同类型其他项的默认状态
  if (data.isDefault === 1) {
    mockDictData.forEach(item => {
      if (item.dictType === mockDictData[index].dictType && item.id !== id) {
        item.isDefault = 0;
        item.updatedTime = now;
      }
    });
  }
  
  return { success: true, data: mockDictData[index] };
}

// 删除字典数据
export function mockDeleteSysDictData(id: number) {
  const index = mockDictData.findIndex(item => item.id === id);
  if (index === -1) {
    throw new Error('字典数据不存在');
  }
  
  mockDictData.splice(index, 1);
  return { success: true };
}

// 更新字典数据状态
export function mockUpdateSysDictDataStatus(id: number, status: number) {
  const index = mockDictData.findIndex(item => item.id === id);
  if (index === -1) {
    throw new Error('字典数据不存在');
  }
  
  const now = new Date().toLocaleString('zh-CN', {
    year: 'numeric',
    month: '2-digit',
    day: '2-digit',
    hour: '2-digit',
    minute: '2-digit',
    second: '2-digit'
  }).replace(/\//g, '-');
  
  mockDictData[index].status = status;
  mockDictData[index].updatedTime = now;
  
  return { data: mockDictData[index] };
}

// 设置默认值
export function mockSetSysDictDataDefault(id: number) {
  const index = mockDictData.findIndex(item => item.id === id);
  if (index === -1) {
    throw new Error('字典数据不存在');
  }
  
  const now = new Date().toLocaleString('zh-CN', {
    year: 'numeric',
    month: '2-digit',
    day: '2-digit',
    hour: '2-digit',
    minute: '2-digit',
    second: '2-digit'
  }).replace(/\//g, '-');
  
  const dictType = mockDictData[index].dictType;
  
  // 取消同类型其他项的默认状态
  mockDictData.forEach(item => {
    if (item.dictType === dictType) {
      item.isDefault = item.id === id ? 1 : 0;
      item.updatedTime = now;
    }
  });
  
  return { data: mockDictData[index] };
}

// 更新字典数据排序
export function mockUpdateSysDictDataSortOrder(id: number, sortOrder: number) {
  const index = mockDictData.findIndex(item => item.id === id);
  if (index === -1) {
    throw new Error('字典数据不存在');
  }
  
  const now = new Date().toLocaleString('zh-CN', {
    year: 'numeric',
    month: '2-digit',
    day: '2-digit',
    hour: '2-digit',
    minute: '2-digit',
    second: '2-digit'
  }).replace(/\//g, '-');
  
  mockDictData[index].sortOrder = sortOrder;
  mockDictData[index].updatedTime = now;
  
  return { data: mockDictData[index] };
}

// 批量删除字典数据
export function mockBatchDeleteSysDictData(ids: number[]) {
  const deletedItems = [];
  
  for (const id of ids) {
    const index = mockDictData.findIndex(item => item.id === id);
    if (index !== -1) {
      deletedItems.push(mockDictData.splice(index, 1)[0]);
    }
  }
  
  return { success: true, data: deletedItems };
}

// 批量更新字典数据状态
export function mockBatchUpdateSysDictDataStatus(ids: number[], status: number) {
  const now = new Date().toLocaleString('zh-CN', {
    year: 'numeric',
    month: '2-digit',
    day: '2-digit',
    hour: '2-digit',
    minute: '2-digit',
    second: '2-digit'
  }).replace(/\//g, '-');
  
  const updatedItems = [];
  
  for (const id of ids) {
    const index = mockDictData.findIndex(item => item.id === id);
    if (index !== -1) {
      mockDictData[index].status = status;
      mockDictData[index].updatedTime = now;
      updatedItems.push(mockDictData[index]);
    }
  }
  
  return { success: true, data: updatedItems };
}

// 根据字典类型获取字典数据选项（用于下拉选择等场景）
export function getMockDictDataOptions(dictType: string) {
  const options = mockDictData
    .filter(item => item.dictType === dictType && item.status === 1)
    .sort((a, b) => a.sortOrder - b.sortOrder)
    .map(item => ({
      label: item.dictLabel,
      value: item.dictValue,
      cssClass: item.cssClass,
      listClass: item.listClass,
      isDefault: item.isDefault
    }));
  
  return { success: true, data: options };
}

// 获取所有可用的字典类型列表（用于筛选下拉）
export function getMockDictTypeOptions() {
  const dictTypes = Array.from(new Set(mockDictData.map(item => item.dictType)));
  const options = dictTypes.map(dictType => {
    const firstItem = mockDictData.find(item => item.dictType === dictType);
    return {
      label: `${dictType}`,
      value: dictType,
      dictTypeId: firstItem?.dictTypeId || 0
    };
  });
  
  return { success: true, data: options };
}

